<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgentsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('agents', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('name')->comment('代理商名称');
            $table->string('app_id', 16)->index()->comment('接口请求AppId');
            $table->string('app_secret', 32)->comment('接口请求Secret');
            $table->string('status', 16)->default(\App\Enums\AvailableStatus::ENABLED)->comment('状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('agents');
    }
}
